<?php $this->load->view("common/page_header");?>

	<div class="form_border user_login" id="user-login">
		<div class="clear"></div>
		<form id="login-form" action="/user/login" method="post">
			<div class="form_row">
				<label class="input_label" for="user_id">信箱 / 昵称：</label><input type="text" class="input_text" name="user_id" id="user_id" value="<?php echo empty($nickname) ? '' : $nickname;?>"/>
			</div>
			<div class="form_row">
				<label class="input_label" for="password">密码：</label><input type="password" class="input_text" name="password" id="password" value="<?php echo empty($pass) ? '' : $pass;?>"/>
			</div>
			<div class="form_action">
				<input type="checkbox" name="remember_password" id="remember_password" class="input_checkbox"><label for="remember_password">记住密码</label>
				<input type="hidden" name="from" value="ajax"></input>
				<input type="button" id="login-button" class="input_button" value="登录"/>
				<span id="login-info" class="hide margin_left10 red"></span>
			</div>
		</form>
	</div>
<script type="text/javascript">
$(document).ready(function(){
	$("#login-button").click(function() {
		$.post("/user/login", $("#login-form").serialize(),function(data){
			if (data == 1) {
				$("#login-info").html("登录成功").show();
				setTimeout("close_colorbox()", 1000);
			} else {
				$("#login-info").html("登录失败").show();
			}
		});
	});
});
function close_colorbox() {
	$.colorbox.close();
	parent.location.reload();
}
</script>
<?php $this->load->view("common/page_footer");?>